#include "cekla.h"
#include "testfunctions.h"
#include "exercises.h"

/**
 *  Main
 */
int main() {
    writeln("******************");
    writeln("Decimal tests");
    writeln("******************");
    test("csupa01", csupa01, 10010);
    test("csupa01", csupa01, 20010);
    test("csupa01", csupa01, 0);
    test("csupa01", csupa01, 1);
    test("csupa01", csupa01, 2);
    test("osztok", (int(*)(int))osztok, 6);
    test("osztok", (int(*)(int))osztok, 1);
    test("osztok", (int(*)(int))osztok, 0);
    test("lnko", lnko, 6, 4);
    test("lnko", lnko, 6, 1);
    test("lnko", lnko, 6, 13);
    test("lnko", lnko, 6, 0);
    test("lnko", lnko, 0, 6);
    test("lnko", lnko, 0, 0);
    test("lnko2", lnko2, 6, 4);
    test("lnko2", lnko2, 6, 1);
    test("lnko2", lnko2, 6, 13);
    test("lnko2", lnko2, 6, 0);
    test("lnko2", lnko2, 0, 6);
    test("lnko2", lnko2, 0, 0);

    writeln("******************");
    writeln("List tests");
    writeln("******************");

    list longlist = cons(1, cons(2, cons(3, cons(4, cons(5, nil)))));
    list paroslist1 = cons(1, cons(1, cons(1, cons(2, nil))));
    list paroslist2 = cons(1, cons(1, cons(1, cons(2, cons(1, cons(1, cons(1, cons(2, nil))))))));
    list paroslist3 = cons(1, cons(1, cons(1, cons(1, nil))));

    list l = paroslist1;
    /*test("length", length, l);
    test("length2", (int(*)(list))length2, l);
    test("lista_noveltje", lista_noveltje, l);
    test("last", last, l);
    running_second_arg_test("insert_nth", insert_nth, l, 0, length2(l) + 1, 0);
    running_second_arg_test("nth1", nth1, l, 0, length2(l)+1);
    running_second_arg_test("take", take, l, 0, length2(l)+1);
    running_second_arg_test("drop", drop, l, 0, length2(l)+1);
    running_second_arg_test("nth1", nth1, l, 0, length2(l)+1);
    running_second_and_third_arg_test("sublist", sublist, l, 0, length2(l)+1, 0, length2(l)+1);
    test("parban", parban, l);
    test("lista_noveltje2", lista_noveltje2, l);
    test("length3", length3, l);
    test("last2", last2, l);
    test("sum", sum, l);
    test("sumsq", sumsq, l);
    test("sumsq2", sumsq2, l);*/


    return 0;
}
